/*
 * XML Type:  XCriteriaGroup
 * Namespace: http://www.seedwill.com/xul/criteria
 * Java type: com.seedwill.xul.criteria.XCriteriaGroup
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.criteria.impl;
/**
 * An XML XCriteriaGroup(@http://www.seedwill.com/xul/criteria).
 *
 * This is a complex type.
 */
public class XCriteriaGroupImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.criteria.XCriteriaGroup
{
    private static final long serialVersionUID = 1L;
    
    public XCriteriaGroupImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SCHEMAGROUPCODE$0 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "schemaGroupCode");
    private static final javax.xml.namespace.QName LABEL$2 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "label");
    private static final javax.xml.namespace.QName CHILDREN$4 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "children");
    private static final javax.xml.namespace.QName CRITERIAEXPRESSION$6 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "criteriaExpression");
    private static final javax.xml.namespace.QName CHILDRENGROUP$8 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "childrenGroup");
    private static final javax.xml.namespace.QName SORT$10 = 
        new javax.xml.namespace.QName("", "sort");
    
    
    /**
     * Gets the "schemaGroupCode" element
     */
    public java.lang.String getSchemaGroupCode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SCHEMAGROUPCODE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "schemaGroupCode" element
     */
    public org.apache.xmlbeans.XmlString xgetSchemaGroupCode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SCHEMAGROUPCODE$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "schemaGroupCode" element
     */
    public void setSchemaGroupCode(java.lang.String schemaGroupCode)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SCHEMAGROUPCODE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SCHEMAGROUPCODE$0);
            }
            target.setStringValue(schemaGroupCode);
        }
    }
    
    /**
     * Sets (as xml) the "schemaGroupCode" element
     */
    public void xsetSchemaGroupCode(org.apache.xmlbeans.XmlString schemaGroupCode)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(SCHEMAGROUPCODE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(SCHEMAGROUPCODE$0);
            }
            target.set(schemaGroupCode);
        }
    }
    
    /**
     * Gets the "label" element
     */
    public java.lang.String getLabel()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LABEL$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "label" element
     */
    public org.apache.xmlbeans.XmlString xgetLabel()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(LABEL$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "label" element
     */
    public void setLabel(java.lang.String label)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LABEL$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(LABEL$2);
            }
            target.setStringValue(label);
        }
    }
    
    /**
     * Sets (as xml) the "label" element
     */
    public void xsetLabel(org.apache.xmlbeans.XmlString label)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(LABEL$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(LABEL$2);
            }
            target.set(label);
        }
    }
    
    /**
     * Gets array of all "children" elements
     */
    public com.seedwill.xul.criteria.XCriteria[] getChildrenArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CHILDREN$4, targetList);
            com.seedwill.xul.criteria.XCriteria[] result = new com.seedwill.xul.criteria.XCriteria[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "children" element
     */
    public com.seedwill.xul.criteria.XCriteria getChildrenArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteria target = null;
            target = (com.seedwill.xul.criteria.XCriteria)get_store().find_element_user(CHILDREN$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "children" element
     */
    public int sizeOfChildrenArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHILDREN$4);
        }
    }
    
    /**
     * Sets array of all "children" element
     */
    public void setChildrenArray(com.seedwill.xul.criteria.XCriteria[] childrenArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(childrenArray, CHILDREN$4);
        }
    }
    
    /**
     * Sets ith "children" element
     */
    public void setChildrenArray(int i, com.seedwill.xul.criteria.XCriteria children)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteria target = null;
            target = (com.seedwill.xul.criteria.XCriteria)get_store().find_element_user(CHILDREN$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(children);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "children" element
     */
    public com.seedwill.xul.criteria.XCriteria insertNewChildren(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteria target = null;
            target = (com.seedwill.xul.criteria.XCriteria)get_store().insert_element_user(CHILDREN$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "children" element
     */
    public com.seedwill.xul.criteria.XCriteria addNewChildren()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteria target = null;
            target = (com.seedwill.xul.criteria.XCriteria)get_store().add_element_user(CHILDREN$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "children" element
     */
    public void removeChildren(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHILDREN$4, i);
        }
    }
    
    /**
     * Gets the "criteriaExpression" element
     */
    public java.lang.String getCriteriaExpression()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CRITERIAEXPRESSION$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "criteriaExpression" element
     */
    public org.apache.xmlbeans.XmlString xgetCriteriaExpression()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(CRITERIAEXPRESSION$6, 0);
            return target;
        }
    }
    
    /**
     * True if has "criteriaExpression" element
     */
    public boolean isSetCriteriaExpression()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CRITERIAEXPRESSION$6) != 0;
        }
    }
    
    /**
     * Sets the "criteriaExpression" element
     */
    public void setCriteriaExpression(java.lang.String criteriaExpression)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CRITERIAEXPRESSION$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CRITERIAEXPRESSION$6);
            }
            target.setStringValue(criteriaExpression);
        }
    }
    
    /**
     * Sets (as xml) the "criteriaExpression" element
     */
    public void xsetCriteriaExpression(org.apache.xmlbeans.XmlString criteriaExpression)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(CRITERIAEXPRESSION$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(CRITERIAEXPRESSION$6);
            }
            target.set(criteriaExpression);
        }
    }
    
    /**
     * Unsets the "criteriaExpression" element
     */
    public void unsetCriteriaExpression()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CRITERIAEXPRESSION$6, 0);
        }
    }
    
    /**
     * Gets array of all "childrenGroup" elements
     */
    public com.seedwill.xul.criteria.XCriteriaGroup[] getChildrenGroupArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CHILDRENGROUP$8, targetList);
            com.seedwill.xul.criteria.XCriteriaGroup[] result = new com.seedwill.xul.criteria.XCriteriaGroup[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "childrenGroup" element
     */
    public com.seedwill.xul.criteria.XCriteriaGroup getChildrenGroupArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaGroup target = null;
            target = (com.seedwill.xul.criteria.XCriteriaGroup)get_store().find_element_user(CHILDRENGROUP$8, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "childrenGroup" element
     */
    public int sizeOfChildrenGroupArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHILDRENGROUP$8);
        }
    }
    
    /**
     * Sets array of all "childrenGroup" element
     */
    public void setChildrenGroupArray(com.seedwill.xul.criteria.XCriteriaGroup[] childrenGroupArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(childrenGroupArray, CHILDRENGROUP$8);
        }
    }
    
    /**
     * Sets ith "childrenGroup" element
     */
    public void setChildrenGroupArray(int i, com.seedwill.xul.criteria.XCriteriaGroup childrenGroup)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaGroup target = null;
            target = (com.seedwill.xul.criteria.XCriteriaGroup)get_store().find_element_user(CHILDRENGROUP$8, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(childrenGroup);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "childrenGroup" element
     */
    public com.seedwill.xul.criteria.XCriteriaGroup insertNewChildrenGroup(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaGroup target = null;
            target = (com.seedwill.xul.criteria.XCriteriaGroup)get_store().insert_element_user(CHILDRENGROUP$8, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "childrenGroup" element
     */
    public com.seedwill.xul.criteria.XCriteriaGroup addNewChildrenGroup()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaGroup target = null;
            target = (com.seedwill.xul.criteria.XCriteriaGroup)get_store().add_element_user(CHILDRENGROUP$8);
            return target;
        }
    }
    
    /**
     * Removes the ith "childrenGroup" element
     */
    public void removeChildrenGroup(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHILDRENGROUP$8, i);
        }
    }
    
    /**
     * Gets the "sort" attribute
     */
    public int getSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SORT$10);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "sort" attribute
     */
    public org.apache.xmlbeans.XmlInt xgetSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(SORT$10);
            return target;
        }
    }
    
    /**
     * True if has "sort" attribute
     */
    public boolean isSetSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(SORT$10) != null;
        }
    }
    
    /**
     * Sets the "sort" attribute
     */
    public void setSort(int sort)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SORT$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SORT$10);
            }
            target.setIntValue(sort);
        }
    }
    
    /**
     * Sets (as xml) the "sort" attribute
     */
    public void xsetSort(org.apache.xmlbeans.XmlInt sort)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(SORT$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(SORT$10);
            }
            target.set(sort);
        }
    }
    
    /**
     * Unsets the "sort" attribute
     */
    public void unsetSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(SORT$10);
        }
    }
}
